import createReq from "../request";
import { Method } from "../type";

export const semesterQuery = (data: any) => {
  return createReq({
    method: Method.POST,
    url: "/semester/searchByNamePage",
    data,
    config: { headers: { "Content-Type": "multipart/form-data" } },
  });
};

export const semesterDelete = (data: any) => {
  return createReq({ method: Method.POST, url: "/semester/delete", data });
};

export const semesterSet = (data: any) => {
  return createReq({ method: Method.POST, url: "/semester/setActive", data });
};

export const semesterAdd = (data: any) => {
  return createReq({ method: Method.POST, url: "/semester/add", data });
};

export const semesterUpdate = (data: any) => {
  return createReq({ method: Method.PUT, url: "/semester/update", data });
};

export const semesterAll = (data: any) => {
  return createReq({ method: Method.GET, url: "/semester/all", data });
};
export const getCurrentSemester = () => {
  return createReq({ method: Method.GET, url: "/semester/current" });
};
